#include <stdio.h>
char *winner[7]={"Player2","Player1","Player1","Tie","Player2","Player2","Player1"};
int main(){
    int n;
    scanf("%d",&n);
    for (int i=0;i<n;i++){
        char s1[100],s2[100];
        scanf("%s %s",s1,s2);
        printf("%s\n",winner[s1[0]-s2[0]+3]);
    }
    return 0;
}
